package com.example.sls.controller.user;

import com.example.sls.pojo.user.SupportTickets;
import com.example.sls.service.intserfaces.user.SupportTicketsService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 客服记录表(SupportTickets)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:44
 */
@RestController
@RequestMapping("user/supportTickets")
public class SupportTicketsController {
  @Autowired
  SupportTicketsService supportTicketsService;

  @GetMapping("queryById")
  SupportTickets queryById(Integer id) {
    return supportTicketsService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<SupportTickets> queryAllByLimit(SupportTickets supportTickets, Integer pageSize, Integer offset) {
    return supportTicketsService.queryAllByLimit(supportTickets, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return supportTicketsService.count();
  }

  @GetMapping("insert")
  int insert(SupportTickets supportTickets) {
    return supportTicketsService.insert(supportTickets);
  }

  @GetMapping("update")
  int update(SupportTickets supportTickets) {
    return supportTicketsService.update(supportTickets);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return supportTicketsService.deleteById(id);
  }
}

